/********************************************************************
	created:	2008/11/06
	created:	6:11:2008   13:54
	filename: 	c:\Symbian\work\fLibary\f\Gfx\fImageFactory2.h
	file path:	c:\Symbian\work\fLibary\f\Gfx
	file base:	fImageFactory2
	file ext:	h
	author:		wangchao

	purpose:	load image
*********************************************************************/
#ifndef __f_IMAGE_FACTORY_H__
#define __f_IMAGE_FACTORY_H__

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <fbs.h>

#include <ImageConversion.h>
#include <BitmapTransforms.h>
#include "ApplicationScheme.h"
#include "fImage.h"

class fImageLoader : public CActive
{
public:
    static fImageLoader* NewL( RFs& fsSession );
    static fImageLoader* NewLC( RFs& fsSession );
    ~fImageLoader();
private:
    fImageLoader( RFs& fsSession );
    void ConstructL();
public:
    TInt DecodeImage( const TDesC& aPath, fImage* aImage, int aFrameNumber );
    TInt DecodeImage( const TDesC8&aData, fImage* aImage, int aFrameNumber );
    //TInt DecodeImage( fImage* aImage, int aFrameNumber );
    TInt DecodeImage( fImage* aImage, int aFrameNumber, TBool isFromData = EFalse );
private:
    void RunL();
    void DoCancel();
public:
    CImageDecoder* iDecoder;
    RFs& iFsSession;
};
#endif // __f_IMAGE_FACTORY_H__
